package com.qike.duola.enums;

public enum ErrorEnums {
    PHONE_NOT_VALITATE                  ("0001","手机号不符合规则"),
    CODES_NOT_NULL                      ("0002","验证码不得为空"),
    CODES_NOT_RIGHT                     ("0003","验证码错误"),
    CODES_OVER_TIME                     ("0004","验证码过期"),
    USERID_NOT_NULL                     ("0005","userid不能为空"),
    CHANNELID_NOT_NULL                  ("0006","频道id不能为空"),
    MAC_NOT_NULL                        ("0007","MAC地址不能为空"),
    CODES_FREQUENTLY                        ("0008","验证码发送频繁"),
    ERROR_DATA                        ("0009","数据异常"),
    COURSE_NOT_START                        ("0010","已审核的单据无法删除"),
    SEND_FAIL                       ("0011","短信发送失败"),
    INSTITUTION_NOT_NULL                       ("0012","机构名称不能为空"),
    INSTITUTION_SCALE_NOT_NULL                       ("0013","机构规模不能为空"),
    PROVINCE_NOT_NULL                       ("0014","省份不能为空"),
    CITY_NOT_NULL                       ("0015","城市不能为空"),
    CONTACT_NOT_NULL                       ("0016","联系人不能为空"),
    CONTACT_PHONE_NOT_NULL                       ("0017","联系电话不能为空"),
    EMAIL_NOT_NULL                       ("0018","邮箱不能为空"),
    SAME_CUSTOMER                       ("0018","客户已存在"),
    ERROR_UPDATE                       ("0019","该数据无法编辑"),
    SAME_CAR_NO                       ("0020","存在相同的车牌号 无法保存"),
    CANT_FINISH                       ("0021","还有车辆未运输完成,请手动完成后结束该计划"),
    CANT_JOIN_TRAIN                       ("0022","已经报名此次活动,请勿重复提交"),
    NULL_APPROVAL                       ("0023","该审批还未设置流程,请先设置审批流程"),
    CAN_NOT_LOAD                       ("0024","车辆已在运输中,无法对其装料"),
    HAVE_TEMPLATE                       ("0025","该标号已存在模板"),
    HAVE_NO_TRANSORDER                       ("0026","暂无运输单"),
    TOO_FAR_FROM_PROJECT                       ("0027","请在对应工地处进行签收"),
    CANT_EDIT_APPROVAL                       ("0028","还有单据正在审批中,无法进行修改"),
    SAME_GOODS_NAME                       ("0029","已存在相同物料名"),
    ;
    private String ecode;

    private String emsg;

    ErrorEnums(String ecode, String emsg) {
        this.ecode = ecode;
        this.emsg = emsg;
    }

    public String getEcode() {
        return ecode;
    }

    public String getEmsg() {
        return emsg;
    }

    public static ErrorEnums statOf(String ecode) {
        for (ErrorEnums state : values())
            if (state.getEcode().equals(ecode))
                return state;
        return null;
    }
}
